<template>
    <wrap title="电子签章">
      <div slot="page">
        <div class='fill-box margin-bottom text-center'>
          <div class="title">
            <i class="fa fa-frown-o"></i>
            <p class="grey-6 margin-top" v-if="desc" >{{desc}}</p>
          </div>
          <div class="fill-btn-box">
              <a class="fill-btn red-bg flex flex-center grey-9-bg" @click="getSignUrl()">
              <span class="light font-18" >电子签章</span>
              </a>
          </div>
            <!-- <a href="javascript:;" class="next-btn blue" @click="skip()">跳过该步骤</a>  -->
        </div>
      </div>
    </wrap>
  </template>
  <script>
    import wrap from '../../components/wrap.vue'
    export default {
      components: {wrap},
      data () {
        return {
          url: '',
          desc: '电子签章失败，请重新进行电子签章'
        }
      },
      methods: {
        getSignUrl () {
          const self = this
          self.$Indicator.open()
          self.$api.sign.getSignUrl().then(res => {
            self.$Indicator.close()
            if (res.code === 0) {
              self.url = res.data
              window.location.href = self.url
            } else {
              self.$MessageBox.alert(res.userMsg ? res.userMsg : res.msg)
            }
          }).always(function () {
            self.$Indicator.close()
          })
        }
      }
    }
  </script>
  <style scoped>
    .fill-box{
        padding-top: 50px;
    }
    .fa{
        font-size: 100px;
    }
    .title{
      margin: 20px 0 50px 0;
    }
  </style>